#define _CRT_SECURE_NO_WARNINGS 1

#include "Queue.h"

void QueueTest1()
{
	Queue que;
	QueueInit(&que);
	QueuePush(&que, 10);
	QueuePush(&que, 20);
	QueuePush(&que, 30);
	QueuePush(&que, 40);
	QueuePush(&que, 50);

	int x = QueueFront(&que);	//10
	printf("%d\n", x);
	x = QueueRear(&que);	//50
	printf("%d\n", x);
	int sz = QueueSize(&que);	//5
	printf("%d\n", sz);


	QueuePop(&que);		
	x = QueueFront(&que);	//20
	printf("%d\n", x);
	x = QueueRear(&que);	//50
	printf("%d\n", x);
	sz = QueueSize(&que);	//4
	printf("%d\n", sz);


	QueuePop(&que);
	QueuePop(&que);
	QueuePop(&que);
	x = QueueFront(&que);	//50
	printf("%d\n", x);
	x = QueueRear(&que);	//50
	printf("%d\n", x);
	sz = QueueSize(&que);	//1
	printf("%d\n", sz);


	QueuePush(&que,60);
	x = QueueFront(&que);	//50
	printf("%d\n", x);

	x = QueueRear(&que);	//60
	printf("%d\n", x);

	sz = QueueSize(&que);	//2
	printf("%d\n", sz);

	QueuePop(&que);
	QueuePop(&que);

	sz = QueueSize(&que);	//0
	printf("%d\n", sz);

	//QueuePop(&que);//fail


	QueueDestroy(&que);

}

int main()
{

	QueueTest1();

	return 0;
}








